<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <meta name="description" content="Xenon Boostrap Admin Panel" />
    <meta name="author" content="" />
    <title>旅游互联网营销管理系统 - <?php echo $GLOBALS['config']['sitename']?></title>
    <link rel="shortcut icon" href="<?php echo URLPRE;?>static/public/images/site.ico" mce_href="<?php echo URLPRE;?>static/public/images/site.ico" type="image/x-icon">
    <base href="<?php echo site_url('static/b2bclient')?>/">

    <link rel="stylesheet" href="assets/css/fonts/linecons/css/linecons.css">
    <link rel="stylesheet" href="assets/css/fonts/fontawesome/css/font-awesome.min.css">
    <link rel="stylesheet" href="assets/css/bootstrap.css">
    <link rel="stylesheet" href="assets/css/xenon-core.css">
    <link rel="stylesheet" href="assets/css/xenon-forms.css">
    <link rel="stylesheet" href="assets/css/xenon-components.css">
    <link rel="stylesheet" href="assets/css/xenon-skins.css">
    <link rel="stylesheet" href="assets/css/custom.css">
    <style>.user-info-navbar{margin-bottom:10px!important}
        .sidebar-menu .main-menu li.active > a {
            color: #ffffff!important;
 </style>
    <script src="assets/js/jquery-1.11.1.min.js"></script>

    <script type="text/javascript"
            src="<?php echo URLPRE; ?>static/template/<?php echo MOBILE_TEMPLATE_NAME ?>/mobile/js/layer/layer.js"></script>

    <!-- 阿里字体-->
    <link href="<?php echo URLPRE;?>static/public/iconfont/iconfont.css" rel="stylesheet" />


    <?php if(check_wap()):?>
        <style>
            .sidebar-menu .logo-env .logo i{ color: #fff;font-size:4rem !important;}
        </style>
        <script type="text/javascript">


            var mql = window.matchMedia("(orientation: portrait)");
            // 如果有匹配，则我们处于垂直视角
            if(mql.matches) {
                // 直立方向
                $(function () {
                    $.extend({cover_layer:function () {
                        var html = '<div id="js-cover-layer" style="pointer-events: auto;position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index:9998; background-color:#000; opacity:0.5; filter:alpha(opacity=30);"></div>';
                        $('body').append(html);
                    }})

                    $.cover_layer();
                })

                $(function () {
                    layer.msg('亲，请将您的屏幕调整为横屏，么么哒 ^_^ ',{
                        icon: 2,
                        time: 3600000 //2秒关闭（如果不配置，默认是3秒）
                    });

                })
            }


            // 添加一个媒体查询改变监听者
            mql.addListener(function(m) {
                if (m.matches) {

                    $(function () {
                        $.extend({cover_layer:function () {
                            var html = '<div id="js-cover-layer" style="pointer-events: auto;position: absolute;top: 0;left: 0;width: 100%;height: 100%;z-index:9998; background-color:#000; opacity:0.5; filter:alpha(opacity=30);"></div>';
                            $('body').append(html);
                        }})

                        $.cover_layer();
                    })

                    $(function () {
                        layer.msg('亲，请将您的屏幕调整为横屏，么么哒 ^_^ ',{
                            icon: 2,
                            time: 3600000 //2秒关闭（如果不配置，默认是3秒）
                        });

                    })
                }
                else {

                    $(function () {
                        layer.msg('已经调整好啦，尽情使用吧 ^_^ ',{
                            icon: 1,
                            time: 2000 //2秒关闭（如果不配置，默认是3秒）
                        });

                    })
                    $('#js-cover-layer').remove();
                }
            });

        </script>
    <?php endif;?>
    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
  <!--  <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>-->
    <![endif]-->


</head>
<body class="page-body">

<div class="page-loading-overlay">
<!--    <div class="loader-2"></div>-->
</div>

<div class="page-container chat-visible"><!-- add class "sidebar-collapsed" to close sidebar by default, "chat-visible" to make chat appear always -->

    <!-- Add "fixed" class to make the sidebar fixed always to the browser viewport. -->
    <!-- Adding class "toggle-others" will keep only one menu item open at a time. -->
    <!-- Adding class "collapsed" collapse sidebar root elements and show only icons. -->
    <div class="sidebar-menu fixed toggle-others" id="js-sidebar-menu">

        <div class="sidebar-menu-inner">

            <header class="logo-env">

                <!-- logo -->
                <div class="logo">

                  <!--  --><?php /*if(TADMIN):*/?>

                   <!--     <div class="logo-pc-wrap">

                            <a href="javascript:;" class="logo-expanded"  >
                                <i class="icon iconfont">&#xe681;</i>
                            </a>
                        </div>
-->

                 <!--   --><?php /*else:*/?>

                            <a href="javascript:;" class="logo-expanded"  >
                                <i class="icon iconfont">&#xe681;</i>
                            </a>
                   <!-- --><?php /*endif;*/?>


                    <a href="javascript:;" class="logo-collapsed">
                        <i class="icon iconfont"  >&#xe681;</i>
                    </a>
                </div>

                <!-- This will toggle the mobile menu and will be visible only on mobile devices -->
                <div class="mobile-menu-toggle visible-xs">
                    <a href="#" data-toggle="user-info-menu">
                        <i class="fa-bell-o"></i>
                        <span class="badge badge-success">7</span>
                    </a>

                    <a href="#" data-toggle="mobile-menu">
                        <i class="fa-bars"></i>
                    </a>
                </div>

            </header>

            <ul id="main-menu" class="main-menu">
                <?php

                $icons = array(
                    'linecons-mail',
                    'linecons-heart',
                    'linecons-star',
//                    'linecons-user',
//                    'linecons-videocam',
//                    'linecons-camera',
//                    'linecons-photo',
//                    'linecons-attach',
//                    'linecons-lock',
//                    'linecons-eye',
                    'linecons-tag',
                    'linecons-thumbs-up',
                    'linecons-pencil',
                    'linecons-comment',
                    'linecons-location',
                    'linecons-cup',
                    'linecons-trash',
                    'linecons-doc',
                    'linecons-note',
                    'linecons-cog',
                    'linecons-params',
                    'linecons-calendar',
                    'linecons-sound',
                    'linecons-clock',
                    'linecons-lightbulb',
                    'linecons-tv',
                    'linecons-desktop',
                    'linecons-mobile',
                    'linecons-cd',
                    'linecons-inbox',
                    'linecons-globe',
                    'linecons-cloud',
                    'linecons-paper-plane',
                    'linecons-fire',
                    'linecons-graduation-cap',
                    'linecons-megaphone',
                    'linecons-database',
                    'linecons-key',
                    'linecons-beaker',
                    'linecons-truck',
                    'linecons-money',
                    'linecons-food',
                    'linecons-shop',
                    'linecons-diamond',
                    'linecons-t-shirt',
                    'linecons-wallet',
                );
                $ci = 0;
                function get_tree_menu($ary, $icons, $ci){
                    $html = '';
                    foreach ($ary as $item) {
                        $ci ++ ;
                        $target = $item['target'] ? $item['target'] : 'iframe_default';
                        $html .= <<<HTML
<li><a target="$target" href="$item[url]"><i class="$icons[$ci]"></i><span class="title">$item[name]</span></a>
HTML;

                        if($item['child']){
                            $html .= "<ul>".get_tree_menu($item['child'], $icons, $ci)."</ul>";
                        }
                        $html .= '</li>';
                    }
                    return "$html";
                }

//                $tree_menu[1] = array('id' => 1, 'parent_id' => 0, 'name' => '网站管理','url' => 'admin/index/setting1');
//                foreach ($tree_menu as $key => $item) {
//                    if($item['name'] == '会员' || $item['name'] == '百科'||$item['name'] == '设置'||$item['name'] == '统计'||$item['name'] == '微信'){
//                        if($item['name'] == '微信'){
//                            $tree_menu[$key]['url'] = site_url('weixin/windex/index');
//                            $tree_menu[$key]['child'] = array();
//                            $tree_menu[$key]['target'] = '_blank';
//                        }
//                         if($item['name'] == '设置'){
//                            foreach ($item['child'] as $key1 => $item1) {
//                                unset($item['child'][$key1]);
//                                if($item1['name'] =='产品帮助'){
//                                    $item1['parent_id'] = 0;
//                                    $tree_menu[99999]=$item1;
//                                }
//                            }
//                        }
//                        $tree_menu[$key]['parent_id'] = 1;
//                        $tree_menu[1]['child'][] = $tree_menu[$key];
//                        unset($tree_menu[$key]);
//                    }
//                    if($tree_menu[$key]['name'] =='产品'){
//                        $tree_menu[$key]['name'] = '产品管理';
//                    }
//                    if($tree_menu[$key]['name'] =='业务'){
//                        $tree_menu[$key]['name'] = '业务管理';
//                    }
//                    if($tree_menu[$key]['name'] =='组织'){
//                        $tree_menu[$key]['name'] = '客户管理';
//                    }
//                    if($tree_menu[$key]['name'] =='销售'){
//                        $tree_menu[$key]['name'] = '销售管理';
//                    }
//                }
//                print_r($tree_menu);
                echo get_tree_menu($tree_menu, $icons, $ci);
                ?>
            </ul>

        </div>

    </div>



    <script>
        var CURRENTURL = '<?php echo get_url();?>';

        $(function () {
            $('#main-menu').find('a').each(function () {
                var src = $(this).attr('href');
                if (src == CURRENTURL || CURRENTURL.indexOf(src) != -1) {
                    var $par = $(this).parent().parent().parent();
                    $('#main-menu li').removeClass('opened').removeClass('active');
                    $par.addClass('opened active');
                    $(this).parent().addClass('active').siblings().removeClass('active');
                }
            });


        })

    </script>

    <div class="main-content">

        <!-- User Info, 提醒 and Menu Bar -->
        <nav class="navbar user-info-navbar" role="navigation">

            <!-- Left links for user info navbar -->
            <ul class="user-info-menu left-links list-inline list-unstyled">

                <li class="hidden-sm hidden-xs">
                    <a href="#" data-toggle="sidebar">
                        <i class="fa-bars"></i>
                    </a>
                </li>

            </ul>


            <!-- Right links for user info navbar -->
            <ul class="user-info-menu right-links list-inline list-unstyled">

                <li class="dropdown user-profile">
                    <a data-toggle="dropdown" style="cursor:pointer">
                        <span>
                        <?php echo $this->session->userdata('admin_user_name')?>
                        <i class="fa-angle-down"></i>
                        </span>
                    </a>

                    <ul class="dropdown-menu user-profile-menu list-unstyled">
                        <li class="last">
                            <a href="<?php echo site_url('admin/index/logout');?>">
                                <i class="fa-lock"></i>
                                退出
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>

        </nav>

        <iframe id="iframe_default" name="iframe_default" src="<?php echo site_url('order/adminhotel/static_list')?>" style="height:82%;width:100%;display:inline;" data-id="default" frameborder="0" scrolling="auto">
        </iframe>

        <!-- Main Footer -->
        <!-- Choose between footer styles: "footer-type-1" or "footer-type-2" -->
        <!-- Add class "sticky" to  always stick the footer to the end of page (if page contents is small) -->
        <!-- Or class "fixed" to  always fix the footer to the end of page -->
        <footer class="main-footer sticky footer-type-1">

            <div class="footer-inner">

                <!-- Add your copyright text here -->
                <div class="footer-text">
                    &copy; <?php echo date('Y')?>
                    <strong>微农家网络科技 inc.</strong>
                    <!--theme by <a href="http://laborator.co" target="_blank">Laborator</a>-->
                </div>


                <!-- Go to Top Link, just add rel="go-top" to any link to add this functionality -->
             <!--   <div class="go-up">

                    <a href="#" rel="go-top">
                        <i class="fa-angle-up"></i>
                    </a>

                </div>-->

            </div>

        </footer>
    </div>
</div>


<!-- Bottom Scripts -->
<script src="assets/js/bootstrap.min.js"></script>
<script src="assets/js/TweenMax.min.js"></script>
<script src="assets/js/resizeable.js"></script>
<script src="assets/js/joinable.js"></script>
<script src="assets/js/xenon-api.js"></script>
<script src="assets/js/xenon-toggles.js"></script>

<!-- JavaScripts initializations and stuff -->
<script src="assets/js/xenon-custom.js"></script>

<!-- Imported scripts on this page -->
<script src="assets/js/toastr/toastr.min.js"></script>
<script src="assets/js/jquery-validate/jquery.validate.min.js"></script>
<script src="assets/js/ajaxForm.js"></script>
<script src="assets/js/device.js"></script>

<script>
    $(function () {
        if(device.ipad())
        {
            $('#js-sidebar-menu').addClass('collapsed');
        }


        $('#main-menu').find('a').on('click', function () {

            if (device.ipad()) {
                $('#main-menu').find('.has-sub').children('ul').removeAttr('style');
                var $ul = $(this).closest('ul');
                if ($ul.attr('class') != 'main-menu') {
                    $ul.css({'top': '-999em'});
                }
            }

            $(this).parent().addClass('active').siblings().removeClass('active');


        });
    })
</script>
</body>
</html>